package com.lyj.mall.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * @author  lyj
 * @date  2020/1/7 23:10
 */
@ApiModel(value="com-lyj-mall-pojo-Product")
@Data
@TableName(value = "mall_product")
public class Product implements Serializable {
    /**
     * 商品id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value="商品id")
    private Integer id;

    /**
     * 分类id,对应mall_category表的主键
     */
    @TableField(value = "category_id")
    @ApiModelProperty(value="分类id,对应mall_category表的主键")
    private Integer categoryId;

    /**
     * 商品名称
     */
    @TableField(value = "name")
    @ApiModelProperty(value="商品名称")
    private String name;

    /**
     * 商品副标题
     */
    @TableField(value = "subtitle")
    @ApiModelProperty(value="商品副标题")
    private String subtitle;

    /**
     * 产品主图,url相对地址
     */
    @TableField(value = "main_image")
    @ApiModelProperty(value="产品主图,url相对地址")
    private String mainImage;

    /**
     * 图片地址,json格式,扩展用
     */
    @TableField(value = "sub_images")
    @ApiModelProperty(value="图片地址,json格式,扩展用")
    private String subImages;

    /**
     * 商品详情
     */
    @TableField(value = "detail")
    @ApiModelProperty(value="商品详情")
    private String detail;

    /**
     * 价格,单位-元保留两位小数
     */
    @TableField(value = "price")
    @ApiModelProperty(value="价格,单位-元保留两位小数")
    private BigDecimal price;

    /**
     * 库存数量
     */
    @TableField(value = "stock")
    @ApiModelProperty(value="库存数量")
    private Integer stock;

    /**
     * 商品状态.1-在售 2-下架 3-删除
     */
    @TableField(value = "status")
    @ApiModelProperty(value="商品状态.1-在售 2-下架 3-删除")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @ApiModelProperty(value="创建时间")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @ApiModelProperty(value="更新时间")
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_CATEGORY_ID = "category_id";

    public static final String COL_NAME = "name";

    public static final String COL_SUBTITLE = "subtitle";

    public static final String COL_MAIN_IMAGE = "main_image";

    public static final String COL_SUB_IMAGES = "sub_images";

    public static final String COL_DETAIL = "detail";

    public static final String COL_PRICE = "price";

    public static final String COL_STOCK = "stock";

    public static final String COL_STATUS = "status";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_UPDATE_TIME = "update_time";
}